package io.xiyou.account1.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.xiyou.account1.dao.model.AccountFreeze;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;

@Repository
public interface AccountFreezeMapper extends BaseMapper<AccountFreeze> {

    /**
     * 减少冻结金额
     *
     * @param accountId
     * @param accountType
     * @param money
     * @return
     */
    int subtractFreezeMoney(@Param("accountId") Long accountId, @Param("accountType") String accountType, @Param("money") BigDecimal money);

    /**
     * 增加冻结金额
     *
     * @param accountId
     * @param accountType
     * @param money
     * @return
     */
    int addFreezeMoney(@Param("accountId") Long accountId, @Param("accountType") String accountType, @Param("money") BigDecimal money);

}